var ArrayUtil = {
	/**
	 * 遍历，并执行fun
	 */
	foreach:function(array,fun){
		if(array && fun){
			var len = array.length;
			for(var i=0;i<len;i++){
				fun(i,array[i]);
			}
			
		}
	},
	/**
	 * 根据索引删除数组的某个元素
	 */
	delByIndex:function(array,index){
		if(!array) return ;
		if(index==undefined) return;
		if(index >= array.length) index=array.length-1;;
		for(var i=index;i<array.length;i++){
			if(i+1<array.length)
				array[i] =array[i+1];	
		}
		array.length = array.length-1;
		
	},
	//判断一个(字符串/数字/数组)是否存在于一个数组中
	inArray: function (obj, arr) {
		var type = typeof obj,
			state = true;
		if (type == 'string' || type == 'number') {
			for (var i in arr) {
				if (arr[i] == obj) {
					return true;
				}
			}
		} else if (type == 'object') {
			for (var j in obj) {
				var result = arguments.callee(obj[j], arr);
				if (!result) {
					state = false;
					break;
				}
			}
			return state;
		}
		return false;
	}
}
